package org.codefinger.json.parser.deserializer;

import org.codefinger.json.parser.JSONArrayDeserializer;
import org.codefinger.json.parser.JSONDeserializer;
import org.codefinger.json.parser.JSONLexer;
import org.codefinger.json.parser.JSONObjectDeserializer;

public class DeserializerForString implements JSONDeserializer {

	public static final DeserializerForString	INSTANCE	= new DeserializerForString();

	private DeserializerForString() {

	}

	
	@Override
	public Object stringValue(String value) {
		return  value;
	}

	
	@Override
	public Object stringValue(JSONLexer jsonLexer) {
		return  jsonLexer.getJSONString();
	}

	
	@Override
	public Object intValue(String value) {
		return  value;
	}

	
	@Override
	public Object floatValue(String value) {
		return  value;
	}

	
	@Override
	public Object falseValue() {
		return  "false";
	}

	
	@Override
	public Object trueValue() {
		return  "true";
	}

	@Override
	public JSONArrayDeserializer createArrayDeserializer() {
		return ArrayDeserializerForNull.INSTANCE;
	}

	@Override
	public JSONObjectDeserializer createObjectDeserializer() {
		return ObjectDeserializerForNull.INSTANCE;
	}

}
